#ifndef CAMERA_H
#define CAMERA_H

#include "vector.h"
#include "origine.h"
#include "ray.h"

#include <QObject>

class Camera : public QObject
{
    Q_OBJECT

    Vector _position;
    Vector _direction;
    double _zoomFactor;
    double _screenDistance;
    Origine _coordinate;

public:
    explicit Camera(Vector position = Vector(0.0,0.0,0.0), Vector direction = Vector(0.0,0.0,0.0), double zoomFactor = 1.0, double screenDistance = 1.0, QObject *parent = 0);

    void moveFoward(double lenght);
    void moveBack(double lenght);
    void moveRight(double lenght);
    void moveLeft(double lenght);
    void moveUp(double lenght);
    void moveDown(double lenght);
    void setZoomFactor(double factor);
    void setAspectRation(double ratio);
    const Vector& position() const;
    const Vector& direction() const;
    Ray getRay(double x, double y, double w, double h) const;

signals:
    
public slots:
    
};

QDataStream &operator<<(QDataStream &, const Camera &);
QDataStream &operator>>(QDataStream &, Camera &);

#endif // CAMERA_H
